package _93DaiLi.impl;

import _93DaiLi.Image;

/**
 * @ProxyImage: 图片接口实现类 图片代理类
 * @author: ZBoHang
 * @time: 2021/9/15 16:08
 */
public class ProxyImage implements Image {
    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if (realImage == null) {
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
